package com.cmy.framework.mvvm.mvvm.view

import android.view.View
import androidx.annotation.LayoutRes
import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding
import com.cmy.framework_base.basics.BasicsActivity

/**
 * @name:
 *  BaseDBActivity
 * @package:
 *  com.cmy.framework.mvvm.mvvm.view
 * @date:
 *  2023/2/2714:27
 * @author
 *    cmy
 * @description
 *  封装VB，实现减少数据代码
 */
abstract class BaseVBActivity<VB : ViewDataBinding>(@LayoutRes contentLayoutId: Int = 0) : BaseActivity() {

    lateinit var binding: VB

    private val layoutId = contentLayoutId

    override fun getContentView(): View{
       val rootView =  layoutInflater.inflate(layoutId, null)
        binding = DataBindingUtil.bind(rootView)!!
        return rootView
    }




}